package io.mft.yapi.util;

import io.mft.commons.config.ConfigProvider;
import io.mft.commons.function.response.kv.KVMap;

public class YApiAccount {
    private static final ThreadLocal<KVMap> yapAccount=new ThreadLocal<>();
    public static KVMap get() {
		KVMap kvMap= yapAccount.get();
		if (kvMap==null) {
			String YApiLoginEmail=ConfigProvider.get("yApi.YApiLoginEmail", "changjian1988@yeah.net");
			String YApiPassword=ConfigProvider.get("yApi.YApiPassword", "changjian1988");
			kvMap=new KVMap();
			kvMap.set("yApi.YApiLoginEmail", YApiLoginEmail);
			kvMap.set("yApi.YApiPassword", YApiPassword);
		}
		return kvMap;
	}
    
    
    public static void set(KVMap kvMap) {
		yapAccount.set(kvMap);
	}
    
    public static void remove() {
		yapAccount.remove();
	}
}
